#!/usr/bin/env bash

PREFIX=$(realpath $(cd "$(dirname "$0")"; pwd))

cd $PREFIX

source src/config/config.sh

if ! hash parcel 2>/dev/null; then
yarn global add parcel-bundler
fi
if [ ! -d node_modules ]; then
yarn
fi

cd $PREFIX/src
rm config.coffee
ln -s config/dev.config.coffee config.coffee
./import.coffee > .import.js

cd $PREFIX
yarn run start
